home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / lib / include / ds5000.md / RCS / syms.h,v < prev    next >
Encoding:
Text File  |  1992-03-19  |  8.3 KB  |  362 lines

  1. head     1.3;
  2. branch   ;
  3. access   ;
  4. symbols  ;
  5. locks    ; strict;
  6. comment  @ * @;
  7.  
  8.  
  9. 1.3
  10. date     92.03.18.16.39.55;  author voelker;  state Exp;
  11. branches ;
  12. next     1.2;
  13.  
  14. 1.2
  15. date     89.11.12.01.33.04;  author rab;  state Exp;
  16. branches ;
  17. next     1.1;
  18.  
  19. 1.1
  20. date     89.11.12.01.29.18;  author rab;  state Exp;
  21. branches ;
  22. next     ;
  23.  
  24.  
  25. desc
  26. @@
  27.  
  28.  
  29. 1.3
  30. log
  31. @changed #ifdef _SYMS_H to #ifndef _SYMS_H
  32. @
  33. text
  34. @/*    @@(#)syms.h    4.2    (ULTRIX)    8/9/88                      */
  35.  
  36. #ifndef _SYMS_H
  37. #define _SYMS_H
  38.  
  39. #ifdef mips
  40. /* --------------------------------------------------- */
  41. /* | Copyright (c) 1986 MIPS Computer Systems, Inc.  | */
  42. /* | All Rights Reserved.                            | */
  43. /* --------------------------------------------------- */
  44. /* $Header: /sprite/src/lib/include/ds3100.md/RCS/syms.h,v 1.2 89/11/12 01:33:04 rab Exp Locker: voelker $ */
  45.  
  46. /*    Copyright (c) 1984 AT&T    */
  47. /*      All Rights Reserved      */
  48.  
  49. /*    THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T    */
  50. /*    The copyright notice above does not evidence any       */
  51. /*    actual or intended publication of such source code.    */
  52.  
  53. /*    Defines for "special" symbols   */
  54.  
  55. #if vax
  56. #define _ETEXT    "_etext"
  57. #define    _EDATA    "_edata"
  58. #define    _END    "_end"
  59. #endif /* vax */
  60.  
  61. #if mips
  62. #ifdef LANGUAGE_C
  63. #define _ETEXT    "etext"
  64. #define    _EDATA    "edata"
  65. #define    _END    "end"
  66. #endif /* LANGUAGE_C */
  67. #ifdef LANGUAGE_PASCAL
  68. #ifdef PASTEL
  69. #define _ETEXT    ('etext'||chr(0))
  70. #define    _EDATA    ('edata'||chr(0))
  71. #define    _END    ('end'||chr(0))
  72. #else
  73. #define _ETEXT    'etext\0'
  74. #define    _EDATA    'edata\0'
  75. #define    _END    'end\0'
  76. #endif /* PASTEL */
  77. #endif /* LANGUAGE_PASCAL */
  78. /*
  79.  * The displacement of the gp is from the start of the small data section
  80.  * is GP_DISP.  The GP_PAD is the padding of the gp area so small negitive
  81.  * offset from gp relocation values can allways be used.
  82.  */
  83. #define GP_PAD    16
  84. #define GP_DISP    (32768 - GP_PAD)
  85. #define GP_SIZE (GP_DISP+32767)
  86. /* "special" symbols for starts of sections */
  87. #ifdef LANGUAGE_C
  88. #define    _FTEXT    "_ftext"
  89. #define    _FDATA    "_fdata"
  90. #define    _FBSS    "_fbss"
  91. #define    _GP    "_gp"
  92. #define    _PROCEDURE_TABLE    "_procedure_table"
  93. #define    _PROCEDURE_TABLE_SIZE    "_procedure_table_size"
  94. #define    _PROCEDURE_STRING_TABLE    "_procedure_string_table"
  95. #define    _COBOL_MAIN    "_cobol_main"
  96. #endif /* LANGUAGE_C */
  97. #ifdef LANGUAGE_PASCAL
  98. #ifdef PASTEL
  99. #define    _FTEXT    ('_ftext'||chr(0))
  100. #define    _FDATA    ('_fdata'||chr(0))
  101. #define    _FBSS    ('_fbss'||chr(0))
  102. #define    _GP    ('_gp'||chr(0))
  103. #define    _PROCEDURE_TABLE    ('_procedure_table'||chr(0))
  104. #define    _PROCEDURE_TABLE_SIZE    ('_procedure_table_size'||chr(0))
  105. #define    _PROCEDURE_STRING_TABLE    ('_procedure_string_table'||chr(0))
  106. #else
  107. #define    _FTEXT    '_ftext\0'
  108. #define    _FDATA    '_fdata\0'
  109. #define    _FBSS    '_fbss\0'
  110. #define    _GP    '_gp\0'
  111. #define    _PROCEDURE_TABLE    '_procedure_table\0'
  112. #define    _PROCEDURE_TABLE_SIZE    '_procedure_table_size\0'
  113. #define    _PROCEDURE_STRING_TABLE    '_procedure_string_table\0'
  114. #endif /* PASTEL */
  115. #endif /* LANGUAGE_PASCAL */
  116.  
  117. #else /* !defined(mips) */
  118.  
  119. #define _ETEXT    "etext"
  120. #define _EDATA    "edata"
  121. #define _END    "end"
  122. #endif /* mips */
  123.  
  124. #ifdef LANGUAGE_C
  125. #define _START    "__start"
  126. #endif /* LANGUAGE_C */
  127. #ifdef LANGUAGE_PASCAL
  128. #ifdef PASTEL
  129. #define _START    ('__start'||chr(0))
  130. #else
  131. #define _START    '__start\0'
  132. #endif /* PASTEL */
  133. #endif /* LANGUAGE_PASCAL */
  134.  
  135. #if mips
  136.  
  137. #include "symconst.h"
  138. #ifdef LANGUAGE_C
  139. #include "sym.h"
  140. /* #include "cmplrs/stsupport.h" */
  141. #endif /* LANGUAGE_C */
  142.  
  143. #else /* !defined(mips) */
  144.  
  145. /*        Storage Classes are defined in storclass.h  */
  146. #include "storclass.h"
  147.  
  148. /*        Number of characters in a symbol name */
  149. #define  SYMNMLEN    8
  150. /*        Number of characters in a file name */
  151. #define  FILNMLEN    14
  152. /*        Number of array dimensions in auxiliary entry */
  153. #define  DIMNUM        4
  154.  
  155.  
  156. struct syment
  157. {
  158.     union
  159.     {
  160.         char        _n_name[SYMNMLEN];    /* old COFF version */
  161.         struct
  162.         {
  163.             long    _n_zeroes;    /* new == 0 */
  164.             long    _n_offset;    /* offset into string table */
  165.         } _n_n;
  166.         char        *_n_nptr[2];    /* allows for overlaying */
  167.     } _n;
  168. #ifndef pdp11
  169.     unsigned
  170. #endif
  171.     long            n_value;    /* value of symbol */
  172.     short            n_scnum;    /* section number */
  173.     unsigned short        n_type;        /* type and derived type */
  174.     char            n_sclass;    /* storage class */
  175.     char            n_numaux;    /* number of aux. entries */
  176. };
  177.  
  178. #define n_name        _n._n_name
  179. #define n_nptr        _n._n_nptr[1]
  180. #define n_zeroes    _n._n_n._n_zeroes
  181. #define n_offset    _n._n_n._n_offset
  182.  
  183. /*
  184.    Relocatable symbols have a section number of the
  185.    section in which they are defined.  Otherwise, section
  186.    numbers have the following meanings:
  187. */
  188.         /* undefined symbol */
  189. #define  N_UNDEF    0
  190.         /* value of symbol is absolute */
  191. #define  N_ABS        -1
  192.         /* special debugging symbol -- value of symbol is meaningless */
  193. #define  N_DEBUG    -2
  194.     /* indicates symbol needs transfer vector (preload) */
  195. #define  N_TV        (unsigned short)-3
  196.  
  197.     /* indicates symbol needs transfer vector (postload) */
  198.  
  199. #define  P_TV        (unsigned short)-4
  200.  
  201. /*
  202.    The fundamental type of a symbol packed into the low
  203.    4 bits of the word.
  204. */
  205.  
  206. #define  _EF    ".ef"
  207.  
  208. #define  T_NULL     0
  209. #define  T_ARG      1          /* function argument (only used by compiler) */
  210. #define  T_CHAR     2          /* character */
  211. #define  T_SHORT    3          /* short integer */
  212. #define  T_INT      4          /* integer */
  213. #define  T_LONG     5          /* long integer */
  214. #define  T_FLOAT    6          /* floating point */
  215. #define  T_DOUBLE   7          /* double word */
  216. #define  T_STRUCT   8          /* structure  */
  217. #define  T_UNION    9          /* union  */
  218. #define  T_ENUM     10         /* enumeration  */
  219. #define  T_MOE      11         /* member of enumeration */
  220. #define  T_UCHAR    12         /* unsigned character */
  221. #define  T_USHORT   13         /* unsigned short */
  222. #define  T_UINT     14         /* unsigned integer */
  223. #define  T_ULONG    15         /* unsigned long */
  224.  
  225. /*
  226.  * derived types are:
  227.  */
  228.  
  229. #define  DT_NON      0          /* no derived type */
  230. #define  DT_PTR      1          /* pointer */
  231. #define  DT_FCN      2          /* function */
  232. #define  DT_ARY      3          /* array */
  233.  
  234. /*
  235.  *   type packing constants
  236.  */
  237.  
  238. #define  N_BTMASK     017
  239. #define  N_TMASK      060
  240. #define  N_TMASK1     0300
  241. #define  N_TMASK2     0360
  242. #define  N_BTSHFT     4
  243. #define  N_TSHIFT     2
  244.  
  245. /*
  246.  *   MACROS
  247.  */
  248.  
  249.     /*   Basic Type of  x   */
  250.  
  251. #define  BTYPE(x)  ((x) & N_BTMASK)
  252.  
  253.     /*   Is  x  a  pointer ?   */
  254.  
  255. #define  ISPTR(x)  (((x) & N_TMASK) == (DT_PTR << N_BTSHFT))
  256.  
  257.     /*   Is  x  a  function ?  */
  258.  
  259. #define  ISFCN(x)  (((x) & N_TMASK) == (DT_FCN << N_BTSHFT))
  260.  
  261.     /*   Is  x  an  array ?   */
  262.  
  263. #define  ISARY(x)  (((x) & N_TMASK) == (DT_ARY << N_BTSHFT))
  264.  
  265.     /* Is x a structure, union, or enumeration TAG? */
  266.  
  267. #define ISTAG(x)  ((x)==C_STRTAG || (x)==C_UNTAG || (x)==C_ENTAG)
  268.  
  269. #define  INCREF(x) ((((x)&~N_BTMASK)<<N_TSHIFT)|(DT_PTR<<N_BTSHFT)|(x&N_BTMASK))
  270.  
  271. #define  DECREF(x) ((((x)>>N_TSHIFT)&~N_BTMASK)|((x)&N_BTMASK))
  272.  
  273. /*
  274.  *    AUXILIARY ENTRY FORMAT
  275.  */
  276.  
  277. union auxent
  278. {
  279.     struct
  280.     {
  281.         long        x_tagndx;    /* str, un, or enum tag indx */
  282.         union
  283.         {
  284.             struct
  285.             {
  286.                 unsigned short    x_lnno;    /* declaration line number */
  287.                 unsigned short    x_size;    /* str, union, array size */
  288.             } x_lnsz;
  289.             long    x_fsize;    /* size of function */
  290.         } x_misc;
  291.         union
  292.         {
  293.             struct            /* if ISFCN, tag, or .bb */
  294.             {
  295.                 long    x_lnnoptr;    /* ptr to fcn line # */
  296.                 long    x_endndx;    /* entry ndx past block end */
  297.             }     x_fcn;
  298.             struct            /* if ISARY, up to 4 dimen. */
  299.             {
  300.                 unsigned short    x_dimen[DIMNUM];
  301.             }     x_ary;
  302.         }        x_fcnary;
  303.         unsigned short  x_tvndx;        /* tv index */
  304.     }     x_sym;
  305.     struct
  306.     {
  307.         char    x_fname[FILNMLEN];
  308.     }     x_file;
  309.         struct
  310.         {
  311.                 long    x_scnlen;          /* section length */
  312.                 unsigned short  x_nreloc;  /* number of relocation entries */
  313.                 unsigned short  x_nlinno;  /* number of line numbers */
  314.         }       x_scn;
  315.  
  316.     struct
  317.     {
  318.         long        x_tvfill;    /* tv fill value */
  319.         unsigned short    x_tvlen;    /* length of .tv */
  320.         unsigned short    x_tvran[2];    /* tv range */
  321.     }    x_tv;    /* info about .tv section (in auxent of symbol .tv)) */
  322. };
  323.  
  324. #define    SYMENT    struct syment
  325. #define    SYMESZ    18    /* sizeof(SYMENT) */
  326.  
  327. #define    AUXENT    union auxent
  328. #define    AUXESZ    18    /* sizeof(AUXENT) */
  329.  
  330. #endif /* mips */
  331. #endif /* mips */
  332. #endif /* _SYMS_H */
  333.  
  334. @
  335.  
  336.  
  337. 1.2
  338. log
  339. @Added #ifdefs to make file idempotent.
  340. @
  341. text
  342. @d3 3
  343. a5 1
  344. #ifdef _SYMS_H
  345. d11 1
  346. a11 1
  347. /* $Header: /sprite/src/lib/include/ds3100.md/RCS/syms.h,v 1.1 89/11/12 01:29:18 rab Exp Locker: rab $ */
  348. @
  349.  
  350.  
  351. 1.1
  352. log
  353. @Initial revision
  354. @
  355. text
  356. @d2 2
  357. d9 1
  358. a9 1
  359. /* $Header: syms.h,v 1031.2 88/05/16 14:40:08 bettina Exp $ */
  360. d297 2
  361. @
  362.